/*******************************************************************************
 * Copyright (c) 2010, 2030 www.itlaobing.cn
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 *******************************************************************************/
package cn.itlaobing.services;

import java.sql.SQLException;
import java.util.List;

import cn.itlaobing.dao.DtoDao;
import cn.itlaobing.entity.DtoEntity;
import cn.itlaobing.exception.BusinessException;

/** 
 * ClassName: DtoService <br/> 
 * Function: Dto业务层 <br/> 
 * date: 2017年11月1日 下午3:35:09 <br/> 
 * 
 * @author 王博 
 * @version  
 * @since JDK 1.8 
 */
public class DtoService {
	private DtoDao dtodao=new DtoDao();
	
	/** 
	 * query:(全查). <br/>
	 * 
	 * @author 王博 
	 * @return
	 * @throws BusinessException 
	 * @since JDK 1.8 
	 */  
	public List<DtoEntity> query(int id) throws BusinessException{
		List<DtoEntity> listdto=null;
		try {
			listdto=dtodao.queryAll(id);
		} catch (SQLException e) {
			throw new BusinessException(e.getMessage());
		}finally {
			try {
				dtodao.close();
			} catch (SQLException e) {
				throw new BusinessException(e.getMessage());
			}
		}
		return listdto;
	}
}
